using System;
using System.Collections.Generic;
using System.Text;

namespace PokerLearner.Poker
{
	public enum PlayType
	{
		SmallBlind,
		BigBlind,
		Check,
		Bet,
		Call,
		Raise,
		AllIn,
		Fold
	}

	[Serializable]
	public class Play
	{
		#region Type

		private PlayType type;
		public PlayType Type
		{
			get { return type; }
		}

		#endregion

		#region Player

		private Player player;
		public Player Player
		{
			get { return player; }
		}

		#endregion

		#region Round State

		private RoundState roundState;
		public RoundState RoundState
		{
			get { return roundState; }
		}

		#endregion

		#region Value

		private int value;
		public int Value
		{
			get { return value; }
			set { this.value = value; }
		}

		#endregion

		#region Constructor

		public Play(PlayType type, Player player, RoundState roundState, int value)
		{
			this.type = type;
			this.player = player;
			this.roundState = roundState;
			this.value = value;
		}

		#endregion

		#region Object Overrides

		public override string ToString()
		{
			string ret = null;

			if (type == PlayType.SmallBlind)
			{
				ret = "Small blinds: " + value;
			}
			else if (type == PlayType.BigBlind)
			{
				ret = "Big blinds: " + value;
			}
			else if (type == PlayType.Check)
			{
				ret = "Checked";
			}
			else if (type == PlayType.Bet)
			{
				ret = "Bet: " + value;
			}
			else if (type == PlayType.Call)
			{
				ret = "Called: " + value;
			}
			else if (type == PlayType.Raise)
			{
				ret = "Raised: " + value;
			}
			else if (type == PlayType.AllIn)
			{
				ret = "All In: " + value;
			}
			else
			{
				ret = "Folded";
			}

			return ret;
		}

		#endregion
	}
}
